<html xmlns:fo="http://www.w3.org/1999/XSL/Format"><head><title>mx.fmxis.FMXISKeypad Class</title><link rel="stylesheet" type="text/css" href="../../../docs.css"></link></head><body><h1>FMXISKeypad Class</h1><p><b>Class </b>mx.fmxis.FMXISKeypad</p><p><b>Inheritance </b>
			
			&gt;
			
		<a href="../FMXISBase/Class.htm">FMXISBase</a>
			
			&gt;
			
		<a href="Class.htm">FMXISKeypad</a></p><div class="description"><p>This class implements a keyboard arranged in a grid.  Users can change the
appearance of buttons by changing the following graphics:</p>
<li><code>defKeypadKey</code> - graphic for keys in up and down positions</li>
<li><code>defKeypadCharsUp</code> - ggraphic overlay for keys in up position</li>
<li><code>defKeypadCharsDown</code> - ggraphic overlay for keys in down position</li>
<br /><br />
<p>The class has the following events:</p>
<li><code>onKeyUp</code> Key pressed.  Value is object with properties <code>num</code> (index) and <code>char</code> (string character)</li>
<li><code>onKeyDown</code> Key released.  Value is same as onKeyUp</li>
<br /><br />
<p>Key-down (<code>onKeyDown</code>, unless changed by the developer)
repeats at <code>repFreq</code> frequency when a key is held down longer than <code>holdDur</code> milliseconds.
Unlike a physical
keyboard, it also allows
you to show an offset of the overlay clips (the key labels) instead of all at once.  This
can be used to simulate a series of keys whose labels change.</p>
<br /><br />
<p>If you have set a non-zero offset, then the number returned in the event still corresponds to
the row and column position (0 is first), but the component returns the character from
the character array respecting the offset.</p>
<br /><br />
<p>This class inherits from FMXISBase to get listener capabilities.</p></div><table border="1" cellpadding="2" cellspacing="0"><tr><th colspan="2" class="ObjectsSummaryHeading">Property Summary</th></tr><tr><td valign="top" width="1%"><span class="Attributes">&nbsp;</span><span class="type">Number</span>&nbsp;</td><td valign="top"><div class="functionNameAndParams">&nbsp;<a href="#_cols">_cols</a></div><div class="functionSummaryLine">Number of columns of keys.</div></td></tr><tr><td valign="top" width="1%"><span class="Attributes">&nbsp;</span><span class="type">Number</span>&nbsp;</td><td valign="top"><div class="functionNameAndParams">&nbsp;<a href="#_rows">_rows</a></div><div class="functionSummaryLine">Number of rows of keys.</div></td></tr><tr><td valign="top" width="1%"><span class="Attributes">&nbsp;</span><span class="type">String</span>&nbsp;</td><td valign="top"><div class="functionNameAndParams">&nbsp;<a href="#className">className</a></div><div class="functionSummaryLine"></div></td></tr><tr><td valign="top" width="1%"><span class="Attributes">&nbsp;</span><span class="type">String</span>&nbsp;</td><td valign="top"><div class="functionNameAndParams">&nbsp;<a href="#evtKeyDown">evtKeyDown</a></div><div class="functionSummaryLine">Name of the on-key-down event sent to listeners when a key is pressed and when it is repeated.</div></td></tr><tr><td valign="top" width="1%"><span class="Attributes">&nbsp;</span><span class="type">String</span>&nbsp;</td><td valign="top"><div class="functionNameAndParams">&nbsp;<a href="#evtKeyUp">evtKeyUp</a></div><div class="functionSummaryLine">Name of the on-key-up event sent to listeners when a key is released.</div></td></tr><tr><td valign="top" width="1%"><span class="Attributes">&nbsp;</span><span class="type">Number</span>&nbsp;</td><td valign="top"><div class="functionNameAndParams">&nbsp;<a href="#holdDur">holdDur</a></div><div class="functionSummaryLine"># of milliseconds after which we repeat key down events.</div></td></tr><tr><td valign="top" width="1%"><span class="Attributes">&nbsp;static&nbsp;</span><span class="type">Array</span>&nbsp;</td><td valign="top"><div class="functionNameAndParams">&nbsp;<a href="#keyEvents">keyEvents</a></div><div class="functionSummaryLine"></div></td></tr><tr><td valign="top" width="1%"><span class="Attributes">&nbsp;</span><span class="type"></span>&nbsp;</td><td valign="top"><div class="functionNameAndParams">&nbsp;<a href="#keyOffset">keyOffset</a></div><div class="functionSummaryLine">Which index should be first displayed in series stored in Up and Down Chars
movie clips</div></td></tr><tr><td valign="top" width="1%"><span class="Attributes">&nbsp;</span><span class="type">Number</span>&nbsp;</td><td valign="top"><div class="functionNameAndParams">&nbsp;<a href="#repFreq">repFreq</a></div><div class="functionSummaryLine"># of millisconds to repeat onKeyDown's, after key has been down <code>holdDur</code>
(so long as <code>holdDur</code> is not -1).</div></td></tr><tr><td valign="top" width="1%"><span class="Attributes">&nbsp;</span><span class="type"></span>&nbsp;</td><td valign="top"><div class="functionNameAndParams">&nbsp;<a href="#showHand">showHand</a></div><div class="functionSummaryLine">Boolean property indicating whether or not to display the hand cursor when the cursor is
over the hit area of a key.</div></td></tr><tr><td valign="top" width="1%"><span class="Attributes">&nbsp;static&nbsp;</span><span class="type">String</span>&nbsp;</td><td valign="top"><div class="functionNameAndParams">&nbsp;<a href="#symbolName">symbolName</a></div><div class="functionSummaryLine"></div></td></tr><tr><td valign="top" width="1%"><span class="Attributes">&nbsp;static&nbsp;</span><span class="type">Object</span>&nbsp;</td><td valign="top"><div class="functionNameAndParams">&nbsp;<a href="#symbolOwner">symbolOwner</a></div><div class="functionSummaryLine"></div></td></tr><tr><td valign="top" width="1%"><span class="Attributes">&nbsp;</span><span class="type"></span>&nbsp;</td><td valign="top"><div class="functionNameAndParams">&nbsp;<a href="#xSpacing">xSpacing</a></div><div class="functionSummaryLine"></div></td></tr><tr><td valign="top" width="1%"><span class="Attributes">&nbsp;</span><span class="type"></span>&nbsp;</td><td valign="top"><div class="functionNameAndParams">&nbsp;<a href="#ySpacing">ySpacing</a></div><div class="functionSummaryLine"></div></td></tr></table><table border="1" cellpadding="2" cellspacing="0" class="inheritedObjects"><tr><th class="InheritedHeading">Properties inherited from mx.fmxis.FMXISBase</th></tr><tr><td><div class="inheritedMemberList"><a href="../FMXISBase/Class.htm#addEventListener">addEventListener</a>, <a href="../FMXISBase/Class.htm#clipParameters">clipParameters</a>, <a href="../FMXISBase/Class.htm#removeEventListener">removeEventListener</a></div></td></tr></table><table border="1" cellpadding="2" cellspacing="0"><tr><th colspan="2" class="ObjectsSummaryHeading">Method Summary</th></tr><tr><td valign="top" width="1%"><span class="Attributes">&nbsp;</span><span class="type">Void</span>&nbsp;</td><td valign="top"><div class="functionNameAndParams">&nbsp;<a href="#execEvent">execEvent</a>(evName:String, evVal, q:Boolean)</div><div class="functionSummaryLine">Given an event string and value that matches what this component would generate, perform the action.</div></td></tr><tr><td valign="top" width="1%"><span class="Attributes">&nbsp;</span><span class="type"></span>&nbsp;</td><td valign="top"><div class="functionNameAndParams">&nbsp;<a href="#pressKey">pressKey</a>(knum, q)</div><div class="functionSummaryLine">Simulate the pressing of key <code>knum</code>.</div></td></tr><tr><td valign="top" width="1%"><span class="Attributes">&nbsp;</span><span class="type"></span>&nbsp;</td><td valign="top"><div class="functionNameAndParams">&nbsp;<a href="#releaseKey">releaseKey</a>(knum, q)</div><div class="functionSummaryLine">Simulate the releasing of key <code>knum</code>.</div></td></tr><tr><td valign="top" width="1%"><span class="Attributes">&nbsp;</span><span class="type"></span>&nbsp;</td><td valign="top"><div class="functionNameAndParams">&nbsp;<a href="#resetKeysToUp">resetKeysToUp</a>(q)</div><div class="functionSummaryLine"></div></td></tr><tr><td valign="top" width="1%"><span class="Attributes">&nbsp;</span><span class="type"></span>&nbsp;</td><td valign="top"><div class="functionNameAndParams">&nbsp;<a href="#setGrid">setGrid</a>(r, c, chars, nk)</div><div class="functionSummaryLine">This method is for resetting the grid at runtime to a new grid configuration.</div></td></tr></table><table border="1" cellpadding="2" cellspacing="0" class="inheritedObjects"><tr><th class="InheritedHeading">Methods inherited from mx.fmxis.FMXISBase</th></tr><tr><td><div class="inheritedMemberList"><a href="../FMXISBase/Class.htm#addListener">addListener</a>, <a href="../FMXISBase/Class.htm#init">init</a>, <a href="../FMXISBase/Class.htm#removeListener">removeListener</a></div></td></tr></table><table border="1" cellpadding="2" cellspacing="0"><tr><th colspan="2" class="ObjectsSummaryHeading">Event Summary</th></tr><tr><td valign="top" width="1%"><span class="Attributes">&nbsp;</span><span class="type"></span>&nbsp;</td><td valign="top"><div class="functionNameAndParams">&nbsp;<a href="#onKeyDown">onKeyDown</a></div><div class="functionSummaryLine"></div></td></tr><tr><td valign="top" width="1%"><span class="Attributes">&nbsp;</span><span class="type"></span>&nbsp;</td><td valign="top"><div class="functionNameAndParams">&nbsp;<a href="#onKeyUp">onKeyUp</a></div><div class="functionSummaryLine"><p>Event generated when user presses a key, and repeatedly if the key is held down for longer
than <code>holdDur</code> milliseconds (repeated at <code>repFreq</code> millisecond frequency).</p>
<p>The event value is an object with properties <code>num</code> (index) and <code>char</code> (string character).</div></td></tr></table><table border="1" cellpadding="2" cellspacing="0"><tr><th class="ObjectsDetailHeading">Property Detail</th></tr></table><div class="DetailRow"><a name="_cols"></a><div class="DetailObjectTitle">_cols</div><div class="DetailObjectDeclaration">public var _cols:Number;</div><div class="DetailDescription">Number of columns of keys. Use <code>setGrid()</code> to change the # of rows at runtime.</div></div><div class="DetailRow"><a name="_rows"></a><div class="DetailObjectTitle">_rows</div><div class="DetailObjectDeclaration">public var _rows:Number;</div><div class="DetailDescription">Number of rows of keys.  Use <code>setGrid()</code> to change the # of rows at runtime.</div></div><div class="DetailRow"><a name="className"></a><div class="DetailObjectTitle">className</div><div class="DetailObjectDeclaration"> var className:String;</div><div class="DetailDescription"></div></div><div class="DetailRow"><a name="evtKeyDown"></a><div class="DetailObjectTitle">evtKeyDown</div><div class="DetailObjectDeclaration">public var evtKeyDown:String;</div><div class="DetailDescription">Name of the on-key-down event sent to listeners when a key is pressed and when it is repeated.</div></div><div class="DetailRow"><a name="evtKeyUp"></a><div class="DetailObjectTitle">evtKeyUp</div><div class="DetailObjectDeclaration">public var evtKeyUp:String;</div><div class="DetailDescription">Name of the on-key-up event sent to listeners when a key is released.</div></div><div class="DetailRow"><a name="holdDur"></a><div class="DetailObjectTitle">holdDur</div><div class="DetailObjectDeclaration">public var holdDur:Number;</div><div class="DetailDescription"># of milliseconds after which we repeat key down events.  If this value is set to -1,
then the component does not repeat key down events.</div></div><div class="DetailRow"><a name="keyEvents"></a><div class="DetailObjectTitle">keyEvents</div><div class="DetailObjectDeclaration"> static var keyEvents:Array;</div><div class="DetailDescription"></div></div><div class="DetailRow"><a name="keyOffset"></a><div class="DetailObjectTitle">keyOffset</div><div class="DetailObjectDeclaration">public function get/set keyOffset()</div><div class="DetailDescription">Which index should be first displayed in series stored in Up and Down Chars
movie clips</div></div><div class="DetailRow"><a name="repFreq"></a><div class="DetailObjectTitle">repFreq</div><div class="DetailObjectDeclaration">public var repFreq:Number;</div><div class="DetailDescription"># of millisconds to repeat onKeyDown's, after key has been down <code>holdDur</code>
(so long as <code>holdDur</code> is not -1).</div></div><div class="DetailRow"><a name="showHand"></a><div class="DetailObjectTitle">showHand</div><div class="DetailObjectDeclaration">public function get/set showHand()</div><div class="DetailDescription">Boolean property indicating whether or not to display the hand cursor when the cursor is
over the hit area of a key.</div></div><div class="DetailRow"><a name="symbolName"></a><div class="DetailObjectTitle">symbolName</div><div class="DetailObjectDeclaration"> static var symbolName:String;</div><div class="DetailDescription"></div></div><div class="DetailRow"><a name="symbolOwner"></a><div class="DetailObjectTitle">symbolOwner</div><div class="DetailObjectDeclaration"> static var symbolOwner:Object;</div><div class="DetailDescription"></div></div><div class="DetailRow"><a name="xSpacing"></a><div class="DetailObjectTitle">xSpacing</div><div class="DetailObjectDeclaration">public function get/set xSpacing()</div><div class="DetailDescription"></div></div><div class="DetailRow"><a name="ySpacing"></a><div class="DetailObjectTitle">ySpacing</div><div class="DetailObjectDeclaration">public function get/set ySpacing()</div><div class="DetailDescription"></div></div><table border="1" cellpadding="2" cellspacing="0"><tr><th class="ObjectsDetailHeading">Method Detail</th></tr></table><div class="DetailRow"><a name="execEvent"></a><div class="DetailObjectTitle">execEvent</div><div class="DetailObjectDeclaration">public function  execEvent(evName:String, evVal, q:Boolean):Void</div><div class="DetailDescription">Given an event string and value that matches what this component would generate, perform the action.
For the keypad component, the events are onKeyDown and onKeyUp, and the value is an object
with a num (index) position and character.</div><div class="DetailParamsTitle">Parameters:</div><div class="DetailParamsLine"><code>evName</code> - Event name (string) must match the event this component generates</div><div class="DetailParamsLine"><code>evVal</code> - (optional) value accompanying the event (if the event has an accompanying value)</div><div class="DetailParamsLine"><code>quiet</code> - (optional) set this to true if component should perform the action but not generate an event (this should be false or undefined, unless you know what you are doing)</div><div class="DetailsExampleTitle">Example</div><div class="DetailsExampleLine">myKeypad.execEvent("onKeyDown", {num:0} ); // presses the top left key</div></div><div class="DetailRow"><a name="pressKey"></a><div class="DetailObjectTitle">pressKey</div><div class="DetailObjectDeclaration"> function  pressKey(knum, q)</div><div class="DetailDescription">Simulate the pressing of key <code>knum</code>.</div><div class="DetailParamsTitle">Parameters:</div><div class="DetailParamsLine"><code>knum</code> - Index of key to press</div><div class="DetailsExampleTitle">Example</div><div class="DetailsExampleLine">myKeypad.pressKey(2); // simulate pressing the third key (row major) in the keypad</div></div><div class="DetailRow"><a name="releaseKey"></a><div class="DetailObjectTitle">releaseKey</div><div class="DetailObjectDeclaration"> function  releaseKey(knum, q)</div><div class="DetailDescription">Simulate the releasing of key <code>knum</code>.</div><div class="DetailParamsTitle">Parameters:</div><div class="DetailParamsLine"><code>knum</code> - Index of key to release</div><div class="DetailParamsLine"><code>quiet</code> - (optional) set this to true if component should perform the action but not generate an event (this should be false or undefined, unless you know what you are doing)</div><div class="DetailsExampleTitle">Example</div><div class="DetailsExampleLine">myKeypad.releaseKey(2); // simulate releasing the third key (row major) in the keypad</div></div><div class="DetailRow"><a name="resetKeysToUp"></a><div class="DetailObjectTitle">resetKeysToUp</div><div class="DetailObjectDeclaration">public function  resetKeysToUp(q)</div><div class="DetailDescription"></div></div><div class="DetailRow"><a name="setGrid"></a><div class="DetailObjectTitle">setGrid</div><div class="DetailObjectDeclaration">public function  setGrid(r, c, chars, nk)</div><div class="DetailDescription">This method is for resetting the grid at runtime to a new grid configuration.</div><div class="DetailParamsTitle">Parameters:</div><div class="DetailParamsLine"><code>rows</code> - Number of rows</div><div class="DetailParamsLine"><code>cols</code> - Number of columns</div><div class="DetailParamsLine"><code>chars</code> - (optional) New character set array</div><div class="DetailParamsLine"><code>noKeys</code> - (optional) Array of key indexes where keys should not appear (row major).  If you pass this in but don't want to change <code>chars</code>, pass <code>undefined</code> for chars.</div><div class="DetailsExampleTitle">Example</div><div class="DetailsExampleLine">myKeypad.setGrid(3, 2); // reset to 3x2 grid
myKeypad.setGrid(2, 2, undefined, [2, 3]); // reset to 2x2 grid with keys 3 and 4 missing</div></div><table border="1" cellpadding="2" cellspacing="0"><tr><th class="ObjectsDetailHeading">Event Detail</th></tr></table><div class="DetailRow"><a name="onKeyDown"></a><div class="DetailObjectTitle">onKeyDown</div><div class="DetailObjectDeclaration"> function  onKeyDown(<i>eventObj</i>)</div><div class="DetailDescription"></div></div><div class="DetailRow"><a name="onKeyUp"></a><div class="DetailObjectTitle">onKeyUp</div><div class="DetailObjectDeclaration"> function  onKeyUp(<i>eventObj</i>)</div><div class="DetailDescription"><p>Event generated when user presses a key, and repeatedly if the key is held down for longer
than <code>holdDur</code> milliseconds (repeated at <code>repFreq</code> millisecond frequency).</p>
<p>The event value is an object with properties <code>num</code> (index) and <code>char</code> (string character).  The
index corresponds to the row and column position (row major order) of the key on the screen.
If you have set a non-zero offset, then the number returned in the event still corresponds to
the row and column position (0 is first), but the component returns the character from
the character array respecting the offset.</p></div></div><br /><br /><hr /><span style='font-size: x-small; font-family: Verdana, Arial'>Documentation generated by <a href='http://wwww.blinex.com/products/bldoc' target='_blank' alt='BLDoc Link'>BLDoc Community Edition</a> from <a href='http://www.blinex.com' target='_blank' alt='B-Line Express Website'>B-Line Express</a>.</body></html>